import jsonServer from "json-server";
import path from "path";

export const initDbRoutes = (app: any) => {
  const dbRouter = jsonServer.router(path.join(__dirname, "../models/db.json"));
  const db1Router = jsonServer.router(
    path.join(__dirname, "../models/db1.json")
  );
  const db2Router = jsonServer.router(
    path.join(__dirname, "../models/db2.json")
  );

  app.use("/api/main", dbRouter);
  app.use("/api/blog", db1Router);
  app.use("/api/db2", db2Router);
};
